import Vue from 'vue';
import App from './App';
import VueRouter from 'vue-router';
//import store from './vuex/store';
import MuseUI from 'muse-ui';
import 'muse-ui/dist/muse-ui.css';
import {routers} from './router';
import axios from 'axios';
import VueAxios from 'vue-axios';
import VueBus from 'vue-bus';
import Components from './components/index';
import './statics/css/main.css';
import Config from './src/api/config';

/*
axios.defaults.baseURL = 'http://qzdsims.52baiqian.com/api/';
axios.defaults.headers.common['access-control-allow-origin'] = 'http://qzdsims.52baiqian.com';
*/
axios.defaults.baseURL = Config + '/api/';
axios.defaults.headers.common['access-control-allow-origin'] = Config;

axios.defaults.timeout = 5000;

Vue.use(VueAxios, axios);
Vue.use(VueRouter);
Vue.use(MuseUI);
Vue.use(Components);
Vue.use(VueBus);

const router = new VueRouter({
    routes: routers
});

router.beforeEach((to, from, next) => {//判断是否登录
    next()
})

router.afterEach(transition => {
});

var vm = new Vue({
    data:require('./components/global'),
    //store,
    router: router,
    render: h => h(App)
}).$mount('#app');